package com.ojoin.trade.supplyloan_core.web.service.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.common.web.service.impl.BaseServiceImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlAlipayInfoDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlAlipayInfo;
import com.ojoin.trade.supplyloan_core.web.service.TbSlAlipayInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 16-1-21
 * Time: 上午10:58
 * To change this template use File | Settings | File Templates.
 */
@Service
public class TbSlAlipayInfoServiceImpl extends BaseServiceImpl<TbSlAlipayInfo> implements TbSlAlipayInfoService {
    @Autowired
    private TbSlAlipayInfoDao dao;
    @Override
    protected BaseDao<TbSlAlipayInfo> getBaseDao() {
        return dao;
    }

    @Override
    public void bindAlipayInfo(TbSlAlipayInfo info) throws BusinessException {
        if(info.getId()!=null){
        	getBaseDao().updateById(info);
        }else{
        	getBaseDao().insert(info);
        }
    }


    @Override
    public TbSlAlipayInfo queryInfoByPlatform(int idOfPlatformUser) throws BusinessException {
        return   ((TbSlAlipayInfoDao)getBaseDao()).queryInfoByPlatform(idOfPlatformUser);
    }
}
